package com.seanchenxi.gwt.wordpress.json.service.model.impl;

import java.util.ArrayList;
import java.util.Date;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.seanchenxi.gwt.wordpress.json.service.model.Attachment;
import com.seanchenxi.gwt.wordpress.json.service.model.Author;
import com.seanchenxi.gwt.wordpress.json.service.model.Category;
import com.seanchenxi.gwt.wordpress.json.service.model.Comment;
import com.seanchenxi.gwt.wordpress.json.service.model.Page;
import com.seanchenxi.gwt.wordpress.json.service.model.Post;
import com.seanchenxi.gwt.wordpress.json.service.model.Tag;
import com.seanchenxi.gwt.wordpress.json.service.util.JsUtil;

public class PostImpl extends JavaScriptObject implements Post, Page {

	protected PostImpl() {
	}

	@Override
	public final native int getId() /*-{
		return this.id;
	}-*/;

	@Override
	public final native void setId(int id) /*-{
		this.id = id;
	}-*/;

	@Override
	public final native String getType() /*-{
		return this.type;
	}-*/;

	@Override
	public final native void setType(String type)/*-{
		this.type = type;
	}-*/;

	@Override
	public final native String getSlug()/*-{
		return this.slug;
	}-*/;

	@Override
	public final native void setSlug(String slug)/*-{
		this.slug = slug;
	}-*/;

	@Override
	public final native String getURL() /*-{
		return this.url;
	}-*/;

	@Override
	public final native void setURL(String url)/*-{
		this.url = url;
	}-*/;

	@Override
	public final native String getStatus() /*-{
		return this.status;
	}-*/;

	@Override
	public final native void setStatus(String status)/*-{
		this.status = status;
	}-*/;

	@Override
	public final native String getTitle()/*-{
		return this.title;
	}-*/;

	@Override
	public final native void setTitle(String title)/*-{
		this.title = title;
	}-*/;

	@Override
	public final native String getTitlePlain()/*-{
		return this.title_plain;
	}-*/;

	@Override
	public final native void setTitlePlain(String titlePlain)/*-{
		this.titlePlain = titlePlain;
	}-*/;

	@Override
	public final native String getContent()/*-{
		return this.content;
	}-*/;

	@Override
	public final native void setContent(String content)/*-{
		this.content = content;
	}-*/;

	@Override
	public final native String getExcerpt()/*-{
		return this.excerpt;
	}-*/;

	@Override
	public final native void setExcerpt(String excerpt)/*-{
		this.excerpt = excerpt;
	}-*/;

	@Override
	public final native Date getCreatedDate()/*-{
		return this.date;
	}-*/;

	@Override
	public final native void setCreatedDate(Date createdDate)/*-{
		this.date = createdDate;
	}-*/;

	@Override
	public final native Date getModifiedDate()/*-{
		return this.modified;
	}-*/;

	@Override
	public final native void setModifiedDate(Date modifiedDate)/*-{
		this.modified = modifiedDate;
	}-*/;

	@Override
	public final ArrayList<Category> getCategories() {
		return JsUtil.convert(getJsArrayCategories());
	}

	@Override
	public final void setCategories(ArrayList<Category> categories) {

	}

	public final native JsArray<CategoryImpl> getJsArrayCategories()/*-{
		return this.categories;
	}-*/;

	public final native void setJsArrayCategories(
			JsArray<CategoryImpl> categories)/*-{
		this.categories = categories;
	}-*/;

	@Override
	public final ArrayList<Tag> getTags() {
		return JsUtil.convert(getJsArrayTags());
	}

	@Override
	public final void setTags(ArrayList<Tag> tags) {

	}

	public final native JsArray<TagImpl> getJsArrayTags()/*-{
		return this.tags;
	}-*/;

	public final native void setJsArrayTags(JsArray<TagImpl> tags)/*-{
		this.tags = tags;
	}-*/;

	@Override
	public final native Author getAuthor()/*-{
		return this.author;
	}-*/;

	@Override
	public final native void setAuthor(Author author)/*-{
		this.author = author;
	}-*/;

	@Override
	public final ArrayList<Comment> getComments() {
		return JsUtil.convert(getJsArrayComments());
	}

	@Override
	public final void setComments(ArrayList<Comment> comments) {

	}

	public final native JsArray<CommentImpl> getJsArrayComments() /*-{
		return this.comments;
	}-*/;

	public final native void setJsArrayComments(JsArray<CommentImpl> comments)/*-{
		this.comments = comments;
	}-*/;

	@Override
	public final ArrayList<Attachment> getAttachments() {
		return JsUtil.convert(getJsArrayAttachments());
	}

	@Override
	public final void setAttachments(ArrayList<Attachment> attachments) {
	}

	public final native JsArray<AttachmentImpl> getJsArrayAttachments() /*-{
		return this.attachments;
	}-*/;

	public final native void setJsArrayAttachments(
			JsArray<AttachmentImpl> attachments)/*-{
		this.attachments = attachments;
	}-*/;

	@Override
	public final native int getCommentCount()/*-{
		return this.comment_count;
	}-*/;

	@Override
	public final native void setCommentCount(int number)/*-{
		this.comment_count = number;
	}-*/;

	@Override
	public final native String getCommentStatus()/*-{
		return this.comment_status;
	}-*/;

	@Override
	public final native void setCommentStatus(String commentStatus)/*-{
		this.comment_status = commentStatus;
	}-*/;
}
